package com.hzncc.flowable_diboot.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonAppend;
import com.hzncc.flowable_diboot.entity.SalesGroupContent;
import com.hzncc.flowable_diboot.entity.SapCustomer;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

public class SapCustomerEditVO implements Serializable {
    private static final long serialVersionUID = -1L;

    @Getter
    @Setter
    public static class SapEntity implements Serializable{
        private static final long serialVersionUID = -1L;
        @JsonProperty("NAME1")
        String NAME1; // 客户名称
        @JsonProperty("KUNNR")
        String KUNNR; // sap编号
        @JsonProperty("COUNTRY")
        String COUNTRY; // 国家
        @JsonProperty("BUKRS")
        String BUKRS; // 公司代码
        @JsonProperty("SORTL")
        String SORTL; // 客户简称
        @JsonProperty("KUKLA")
        String KUKLA; // 客户分类
        @JsonProperty("BRSCH")
        String BRSCH; // 客户性质
        @JsonProperty("BRAN1")
        String BRAN1; // 客户行业
        @JsonProperty("KALKS")
        String KALKS; // 定价过程
        @JsonProperty("REGION")
        String REGION; // 省份
        @JsonProperty("KTOKD")
        String KTOKD; // 客户账户组
        @JsonProperty("VKORG")
        String VKORG; // 销售组织
        @JsonProperty("VKBUR")
        String VKBUR; // 销售部门
        @JsonProperty("VTWEG")
        String VTWEG; // 分销渠道
        @JsonProperty("SPART")
        String SPART; // 产品组
        @JsonProperty("KTGRD")
        String KTGRD; // 账户分配
        @JsonProperty("TAXKD")
        String TAXKD; // 客户税分类
    }

    private SapEntity sap;

    private SapCustomer customer;

    private List<SalesGroupContent> salesGroups;

    private String customId;

    public void setCustomer(SapCustomer customer) {
        this.customer = customer;
        sap = new SapEntity();
        sap.setNAME1(customer.getName());
        sap.setKUNNR(customer.getSapNo());
        sap.setCOUNTRY(customer.getCountry());
        sap.setBUKRS(customer.getCompanyCode());
        sap.setSORTL(customer.getShortName());
        sap.setKUKLA(customer.getCate());
        sap.setBRSCH(customer.getNature());
        sap.setBRAN1(customer.getBusiness());
        sap.setKALKS(customer.getPriceProcess());
        sap.setREGION(customer.getProvince());
        sap.setKTOKD(customer.getAccountGroup());
        sap.setVKORG(customer.getSalesOrg());
        sap.setVKBUR(customer.getSalesDept());
        sap.setVTWEG(customer.getChannel());
        sap.setSPART(customer.getProduGroup());
        sap.setKTGRD(customer.getDis());
        sap.setTAXKD(customer.getTaxCate());
        customId = customer.getCustomerId();
    }

    public void setSalesGroups(List<SalesGroupContent> salesGroups) {
        this.salesGroups = salesGroups;
    }

    public SapEntity getSap() {
        return sap;
    }

    public SapCustomer getCustomer() {
        return customer;
    }

    public List<SalesGroupContent> getSalesGroups() {
        return salesGroups;
    }

    public void setSap(SapEntity sap) {
        this.sap = sap;
    }

    public String getCustomId() {
        return customId;
    }

    public void setCustomId(String customId) {
        this.customId = customId;
    }
}
